import { Menu } from "electron";
import { isDev } from "./utils";

export const getMenus = (win) => {
  const menuTemp = [
    {
      label: "功能选项",
      submenu: isDev()
        ? [
            {
              label: "控制台",
              accelerator: "ctrl+i",
              click: () => {
                win.webContents.openDevTools();
              },
            },
            {
              label: "刷新",
              accelerator: "ctrl+r",
              click: () => {
                win.reload();
              },
            },
          ]
        : [],
    },
  ];
  return Menu.buildFromTemplate(menuTemp);
};
